﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing.Design;
using System.Windows.Forms;
namespace MainProGrid
{
    public class UrlEidtor : UITypeEditor  
    {
        public List<string> Urls { get; set; }
        public List<string> Descriptions { get; set; }
        public override UITypeEditorEditStyle GetEditStyle(System.ComponentModel.ITypeDescriptorContext context)
        {
            return UITypeEditorEditStyle.Modal;
        }
        public override object EditValue(System.ComponentModel.ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            UrlFrm urlfrm = new UrlFrm();
            urlfrm.Value = value.ToString();
            urlfrm.Urls = Urls;
            urlfrm.Descriptions = Descriptions;
            if (urlfrm.ShowDialog() == DialogResult.OK) 
            {
                return urlfrm.Value;
            }
            return value;
        }
    }
}
